<?php

namespace App\Console;


use App\Console\Commands\DbAddChannel;
use App\Console\Commands\FilePermissionCommand;
use App\Console\Commands\GtxyQueryCommand;
use App\Console\Commands\HkrtStoreAudit;
use App\Console\Commands\JdStoreAudit;
use App\Console\Commands\JobTestCommand;
use App\Console\Commands\MoveOrderToBiCommand;
use App\Console\Commands\MoveStoreCommand;
use App\Console\Commands\MyBankStoreAudit;
use App\Console\Commands\NewLandStoreAudit;
use App\Console\Commands\PengyiPengCommand;
use App\Console\Commands\Quota\QuotaAutoSettingCommand;
use App\Console\Commands\Settlement;
use App\Console\Commands\SyncOrderStatus\CronSyncOrderStatusCommand;
use App\Console\Commands\SyncOrderStatus\QueryOrderStatusCommand;
use App\Console\Commands\VbillaStoreAudit;
use App\Console\Commands\VbillOrderSuccess;
use App\Console\Commands\VbillRateSaveLogCommand;
use App\Console\Commands\VbillStoreAudit;
use App\Console\Commands\WithholdTLCommand;
use App\Console\Commands\WithholdTLValidCommand;
use App\Console\Commands\WxStoreAudit;
use App\Console\Commands\ZftStoreAudit;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;


class Kernel extends ConsoleKernel
{

    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        MyBankStoreAudit::class,
        JdStoreAudit::class,
        NewLandStoreAudit::class,
        Settlement::class,
        VbillStoreAudit::class,
        ZftStoreAudit::class,
        VbillaStoreAudit::class,
        HkrtStoreAudit::class,
        VbillOrderSuccess::class,
        DbAddChannel::class,
        PengyiPengCommand::class,
        CronSyncOrderStatusCommand::class,
        WithholdTLCommand::class,
        WithholdTLValidCommand::class,
        MoveOrderToBiCommand::class,
        JobTestCommand::class,
        QuotaAutoSettingCommand::class,
        FilePermissionCommand::class,
        QueryOrderStatusCommand::class,
        MoveStoreCommand::class,
        GtxyQueryCommand::class,
        VbillRateSaveLogCommand::class,
    ];

    /**
     * Define the application's command schedule.
     *
     * @param \Illuminate\Console\Scheduling\Schedule $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        // $schedule->command('inspire')
        //          ->hourly();
        //$schedule->command('backup:clean')->daily()->at('01:00');
        // $schedule->command('backup:run')->daily()->at('02:00');
        $schedule->command('mybank-audit')->everyMinute();
        $schedule->command('jd-audit')->everyMinute();
        $schedule->command('newland-audit')->hourly();//每小时调用
        $schedule->command('vbill-audit')->everyMinute();
        $schedule->command('zft-audit')->everyMinute();
        $schedule->command('vbilla-audit')->everyMinute();
        $schedule->command('hkrt-audit')->everyMinute();
        $schedule->command('vbill_order_query')->everyMinute();

        //商户结算
        $schedule->command('settlement')->everyMinute()->between('00:00', '08:00');
        $schedule->command('settlement')->everyMinute()->between('22:00', '23:59');
        //$schedule->command('backup:clean')->everyMinute();
        //$schedule->command('backup:run')->everyMinute();
        //$schedule->command('settlement')->everyMinute()->between('00:00', '0:00');

        //测试调度者的权限
        $schedule->command('file_permission')->everyMinute();
        /**
         * 每日凌晨执行
         */
        $schedule->command('vbill-rate-save-log-command')->daily()->withoutOverlapping();
    }

    /**
     * Register the Closure based commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        require base_path('routes/console.php');
    }
}
